#define _CRT_SECURE_NO_WARNINGS

#include "game.h"

void menu()
{
	printf("************************\n");
	printf("*******  1.PLAY  *******\n");
	printf("*******  0.EXIT  *******\n");
	printf("************************\n");
}



void game()
{
	char mine[ROWS][COLS];
	char show[ROWS][COLS];
	inital(mine, ROWS, COLS, '0');
	inital(show, ROWS, COLS, '*');
	//display(mine, ROW, COL);
	display(show, ROW, COL);

	setmine(mine, ROW, COL);
	//display(mine, ROW, COL);
	findmine(mine, show, ROW, COL);

}



int main()
{
	srand((unsigned int)time(NULL));
	int input = 0;
	do
	{
		menu();
		printf("Please enter the number---> ");
		scanf("%d", &input);
		system("cls");
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("Exit the game.\n");
			break;
		default:
			printf("Input error, please re-enter.\n");
			break;
		}
	} while (input);
	return 0;
}